home *** CD-ROM | disk | FTP | other *** search
/ PCGUIA 117 / PC Guia 117.iso / Software / Produtividade / Software3 / Product4 / Data1.cab / _EECCF4863D3243639C1D74C0CA4F3963 < prev    next >
Encoding:
Text File  |  2004-10-19  |  4.9 KB  |  145 lines

  1. /*******************************************************************/
  2. /*                                                                 */
  3. /*                      ADOBE CONFIDENTIAL                         */
  4. /*                   _ _ _ _ _ _ _ _ _ _ _ _ _                     */
  5. /*                                                                 */
  6. /* Copyright 2004 Adobe Systems Incorporated                       */
  7. /* All Rights Reserved.                                            */
  8. /*                                                                 */
  9. /* NOTICE:  All information contained herein is, and remains the   */
  10. /* property of Adobe Systems Incorporated and its suppliers, if    */
  11. /* any.  The intellectual and technical concepts contained         */
  12. /* herein are proprietary to Adobe Systems Incorporated and its    */
  13. /* suppliers and may be covered by U.S. and Foreign Patents,       */
  14. /* patents in process, and are protected by trade secret or        */
  15. /* copyright law.  Dissemination of this information or            */
  16. /* reproduction of this material is strictly forbidden unless      */
  17. /* prior written permission is obtained from Adobe Systems         */
  18. /* Incorporated.                                                   */
  19. /*                                                                 */
  20. /*******************************************************************/
  21.  
  22.  
  23. /*
  24. **-----------------------------------------------------------------------------
  25. ** Effect File Variables
  26. **-----------------------------------------------------------------------------
  27. */
  28.  
  29. uniform float4x4    gWorldViewProj : WorldViewProjection; // This matrix will be loaded by the application
  30. uniform float4x4    gWorldViewInverse;
  31. uniform float4x4    gWorldView;
  32. uniform float4x4    gWorld;
  33. uniform float4x4    gViewProj;
  34. uniform float        gAspectRatio;
  35. uniform float4x4    gTransformMat;
  36. uniform float3        gLookAtVector = float3(0.0f,0.0f,1.0f); //const vector used to determine the texcoordinate set to use
  37. texture                gVideoTextureA;
  38. texture                gVideoTextureB;
  39.  
  40.  
  41. /*
  42. **-----------------------------------------
  43. **        Sampler States
  44. **-----------------------------------------
  45. */
  46. //incoming video texture A
  47. sampler SamplerA = sampler_state
  48. {
  49.     Texture   = (gVideoTextureA);
  50.     MipFilter = LINEAR;
  51.     MinFilter = LINEAR;
  52.     MagFilter = LINEAR;
  53. };
  54. //incoming video texture B
  55. sampler SamplerB = sampler_state
  56. {
  57.     Texture   = (gVideoTextureB);
  58.     MipFilter = LINEAR;
  59.     MinFilter = LINEAR;
  60.     MagFilter = LINEAR;
  61. };
  62. /*
  63. **-----------------------------------------------------------------------------
  64. ** Vertex Definitions
  65. **-----------------------------------------------------------------------------
  66. ** APP_OUTPUT is the structure in which we receive the vertices from the application
  67. */
  68. struct APP_OUTPUT
  69. {
  70.     float3 mPosition    : POSITION;
  71.     float3 mNormal        : NORMAL;
  72.     float2 mTexCoordA    : TEXCOORD0;
  73.     float2 mTexCoordB    : TEXCOORD1;
  74.  
  75. };
  76.  
  77. /* 
  78. ** Pixel Shader structure declaration 
  79. */
  80. struct VS_OUTPUT 
  81. {
  82.     float4 mHPosition        : POSITION;        // coord position in window
  83.     float2 mTexcoordA        : TEXCOORD0;    // texture coordinates
  84.     float2 mTexcoordB        : TEXCOORD1;
  85.     float  mFlag            : TEXCOORD2;
  86. };
  87.  
  88. /*
  89. **-------------------------------------------------------------------------
  90. ** Spiral Flip Transition effect - Vertex Shader
  91. **-------------------------------------------------------------------------
  92. */
  93. VS_OUTPUT spiralflip_vs(APP_OUTPUT In)
  94. {
  95.     VS_OUTPUT Out;
  96.  
  97.     // copy texture coordinates
  98.     Out.mTexcoordA.xy = In.mTexCoordA.xy;
  99.     Out.mTexcoordB.xy = In.mTexCoordB.xy;
  100.     
  101.     // transform vertex position into homogenous clip-space
  102.     Out.mHPosition = mul(gWorldViewProj,mul(gTransformMat,float4(In.mPosition.x*gAspectRatio,In.mPosition.y,In.mPosition.z,1.0f)));
  103.     // transform the normal accordingly
  104.     float3 normal = mul(gTransformMat,mul(gWorldView,float4(In.mNormal.xyz,1.0f)));
  105.     
  106.     // this flag determines which side the normal is, in turn used to pick up the appropriate texcoordinate set
  107.     Out.mFlag = 0.0f;
  108.     float normalDir = dot(float3(0,0,normal.z),gLookAtVector);
  109.     if(normalDir<=0.0f)
  110.     {
  111.         Out.mFlag = 1.0f;
  112.     }
  113.     return Out;
  114. }
  115.  
  116.  
  117. /*
  118. **-------------------------------------------------------------------------
  119. ** Spiral Flip Transition effect - pixel Shader 1_3
  120. **-------------------------------------------------------------------------
  121. */
  122.  
  123. float4 spiralflip_ps(VS_OUTPUT In) : COLOR
  124. {   
  125.     float4 color1 = tex2D( SamplerA, In.mTexcoordA );
  126.     float4 color2 = tex2D( SamplerB, In.mTexcoordB );
  127.     float4 color = lerp(color1,color2,In.mFlag);
  128.     return color;
  129. }
  130.  
  131. technique spiralflip_transition_1_3
  132. {
  133.     pass Pass0
  134.     {
  135.         Sampler[0] = (SamplerA);
  136.         Sampler[1] = (SamplerB);
  137.     
  138.         VertexShader = compile vs_1_1 spiralflip_vs();
  139.         PixelShader  = compile ps_1_1 spiralflip_ps();
  140.         //[NOTE] anroy 07/29/04: ps_1_3 was causing problems on PS1.4 cards.
  141.         //so we changed it to ps_1_1, which seems to work for all cards tested.
  142.         
  143.     }
  144. }
  145.